package com.grudesign.stutrip.controller;

import com.grudesign.stutrip.common.ReturnInfo;
import com.grudesign.stutrip.service.imgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("imgUpload")
public class imgController {
    @Autowired
    private imgService  imgService;
    @PostMapping
    public Object upLoadImg(MultipartFile files){
        String url = imgService.upLoadImg(files);
        return new ReturnInfo("200","ok").data("url",url);
    }
}
